< previous page page_267 next page >

Page 267
(table continued from previous page)
EventDescription
WillChangeFieldThis event happens before a change is made to a field object in the recordset. You can use this event to validate a particular value in one of the fields and even cancel the pending operation.
FieldChangeCompleteThis event is called after the value of one or more field objects has changed.
WillMoveThis event fires prior to the user moving to a new record in the recordset.
MoveCompleteThis event fires after a move has happened in the data control either forward, backward, or to a specific record.
WillChangeRecordThis event fires prior to the user changing a record.
RecordChangeCompleteThis event fires after a record has been changed.
WillChangeRecordsetThis event fires before a recordset is rebuilt or refreshed from the underlying data source.
RecordsetChangeCompleteThis event fires after the recordset has been rebuilt or refreshed from the underlying data source.

Order of Events
The order in which these events occur in the ADO data control is very important and is something you must learn. The ADO data control loads even before the form is loaded. First, the Form_Initialize() event occurs; then the WillMove and MoveComplete events occur twice in a row. Lastly, the Form_Load() event occurs. In the first example in this chapter, Ive placed several Debug.Print statements to show the order of the events.
EXERCISE
Look at Events for Data Control
1. Load the sample project for this chapter.
2. Bring up the Immediate window by pressing Ctrl+G.
3. Run the sample project.
4. Click the first command button to run the first sample form.
5. You should see results appear in the Immediate window in the order they occur (see Figure 13.1).

 
< previous page page_267 next page >

If you like this book, buy it!